<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"+ request.getServerName() + ":" + request.getServerPort()+ path + "/";
%>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=11">
         <%--  <link rel="stylesheet" href="<%=basePath%>style/common.css"> --%>
        <link rel="stylesheet" href="<%=basePath%>style/cssreset.css">
        
         <link rel="stylesheet" href="<%=basePath%>style/pagination.css">
        <link rel="stylesheet" href="<%=basePath%>style/style.css">
        <link rel="stylesheet" href="<%=basePath%>style/style2.css">
        <link rel="stylesheet" href="<%=basePath%>css/mycss.css">  
         <link rel="stylesheet" href="<%=basePath%>css/mystyle.css"> 
        <script src="<%=basePath%>js/jquery.min.js"></script>
        <script src="<%=basePath%>js/jquery.pagination.js"></script>
           <script src="<%=basePath%>salejihui/My97DatePicker/WdatePicker.js"></script>
           <style>
           	.tab{
				border-top:1px solid #1fd4fb;
				width:100%;
			}
			.thed{
				background:#ecf6f8;
			}
			.tbodys{
				background:#fff;
				font-size:14px;
			}
			td{
				padding:6px 15px;
				text-align:center;
				color:#555;
			}
			thead th{
				width: 100%;
			    height: 45px;
			    line-height: 45px;
			    background: #2f4050;
			    border-radius: 5px;
			    color: #fff;
			    font-size: 18px;
			    text-align: center;
			    margin-top: 0px;
			    position: relative;
			}
			tbody th{
				text-align:center;
				border:none;
			}
			#cover3{
				display: none;
			    position: fixed;
			    z-index: 6;
			    top: 50%;
			    left: 50%;
			    margin-left:-335px;
			    margin-top:-270px;
			}
			#cover3 td{
				border:none;
			}
			.covers{
				background:#fff;
				width:100%;
				height:100%;
			}
			input{
				float:none;
			}
           </style>
        <script>
        	
            $(function(){
            	/* $(".light3").click(function(e){
			    		$('body').css("overflow","hidden")
			        e.preventDefault();
			        $("#cover4").css("display","block");
			        $("#cover4").animate({
			            width: "100%",
			            height: "1800px",
			            top: "0",
			            left: "0"
			        },10);
			        
			    }); */
			    $(".close").click(function(){
			    	$('body').css("overflow","scroll");
			    	$('body').css('overflow-x','hidden');
			        $("#cover4").removeAttr("style");
			        $("#cover-content3").removeAttr("style");
			    });


			    /* $(".more").click(function(e){
			    		$('body').css("overflow","hidden")
			        e.preventDefault();
			        $("#cover3").css("display","block");
			        $("#cover3").animate({
			            width: "100%",
			            height: "1800px",
			            top: "0",
			            left: "0"
			        },10);
			        
			    }); */
			    $(".close").click(function(){
			    	$('body').css("overflow","scroll");
			    	$('body').css('overflow-x','hidden');
			        $("#cover3").removeAttr("style");
			        $("#cover-content2").removeAttr("style");
			    });
                $('.sh1').mouseover(function(event) {
                    $('.showhide1').css('display', 'block');
                });
                $('.sh1').mouseout(function(event) {
                    $('.showhide1').css('display', 'none');
                });
                $('.sh2').mouseover(function(event) {
                    $('.showhide2').css('display', 'block');
                });
                $('.sh2').mouseout(function(event) {
                    $('.showhide2').css('display', 'none');
                });
                $('.sh3').mouseover(function(event) {
                    $('.showhide3').css('display', 'block');
                });
                $('.sh3').mouseout(function(event) {
                    $('.showhide3').css('display', 'none');
                });
                
            })
        </script> 
       
    </head>
    <body>
     <c:if test="${show!=null}">
      <script type="text/javascript">
      window.onload=function(){  
    	     alert("${show}");
    	} 
      </script>
      </c:if>
    	<div class="bigbox xlbox">
    		<nav class="daohan">
                <ul>
                	<li class="sh1">
                        <a href="<%=basePath %>notice/findByAll.action"><p class="mline"><span class="smallicon" id="current1"></span><span class="navtxt">首页</span></p></a>  
                    </li>
                    <li>
                        <a href="<%=basePath %>client/qiangenzongcount.action?zhuizong=0"  ><p class="mline"><span class="smallicon" id="current11"></span><span class="navtxt"  >用户开发</span></p></a>
                    </li>
                    <li>
                        <a href="<%=basePath %>client/selectDepOrSta.action?start=1">
                            <p class="mline">
                                <span class="smallicon" id="ziji11"></span>
                                <span class="navtxt">代理开发</span>
                            </p>
                        </a>
                    </li>
                   <%--  <li class="sh2">
                        <a href="<%=basePath %>client/selectByStaffAnd.action?start=1"><p class="mline"><span class="smallicon one1"></span><span class="navtxt">客户资料</span><span class="ripic"></span></p></a>
                        <div class="showhide2">
                            <a href="<%=basePath %>client/selectByStaffAnd.action" style="font-size:14px;background:#435565;">
                             <p class="mline mline2">
                                <span class="smallicon" id="ziji3"></span>
                                <span class="navtxt" style="font-size: 14px;color:#929da8;">用户资料</span>
                             </p>
                             </a> 

                             <a href="<%=basePath %>client/selectByStaffAnd.action?start=1" style="font-size:14px;margin-top:-22px;background:#435565;">
                             <p class="mline mline2">
                                <span class="smallicon" id="ziji34"></span>
                                <span class="navtxt" id="current2" style="font-size: 14px;color:#929da8;">代理资料</span>
                             </p>
                             </a>    
                        </div>
                    </li> --%>
                    <li>
                        <a href="<%=basePath %>approve/count.action?pageSize=0" id="sline"><p class="mline"><span class="smallicon" id="ziji8"></span><span class="navtxt" id="current2">合同审批</span></p></a> 
                    </li>
                    <li>
                         <a href="<%=basePath%>page/pacts.jsp">
                             <p class="mline"><span class="smallicon one222"></span><span class="navtxt">审批详情</span></p>
                         </a>
                        
                    </li>
                    
                     <li>
                        <a href="<%=basePath %>Operate/count.action">
                             <p class="mline"><span class="smallicon" id="yunyin2"></span><span class="navtxt">运营管理</span></p>
                         </a>
                    </li>  
                    
                   <li>
                        <a href="#"><p class="mline"><span class="smallicon one3"></span><span class="navtxt">产品资源库</span></p></a>
                    </li>
                    <c:if test="${backstage == 1}">
                    	<li>
	                        <a href="<%=basePath %>client/findByAllGr.action"><p class="mline"><span class="smallicon one333"></span><span class="navtxt">后台管理</span></p></a>
	                    </li>
                    </c:if>
                </ul>
            </nav>
            
    		<div class="showbox">
                <h2>进 入 合 同 审 核<span class="exit"><span class="ex1">姓名:${staff.staff_name}</span>
					<a href="../login/tuichustaff.action" class="ex2"><span class="exicon2"></span>切换账号</a>
					<a href="../login/tuichustaff.action" class="ex3"><span class="exicon3"></span>退出账号</a>
				</span></h2>
                <div class="showbox2">
	    		
	    			<div class="aaa">
		    			<div class="smalltitle">
							
							
							<a href="<%=basePath%>approve/count.action?pageSize=0" style="width:160px;top:6px;"><span class="imgmove imgmove2" style="top:2px;"><img src="../images/fanhui.png" alt=""></span>&nbsp;&nbsp;返回首页</a>
		 					 <form action="<%=basePath%>audits/count.action" method="post" style="float:right;margin-right:260px;" onsubmit="return tims()">
		 					 	<input type="text" name="condition" value="${condition}" id="times" placeholder="申请名称" style="width:200px;height:38px;border:1px solid #ccc;border-radius:5px;position:relative;top:6px;color:#ccc;font-family:'微软雅黑'">
								<input type="submit" value="搜索" style="width:60px;height:38px;position:relative;top:6px;border:none;text-align:center;border-radius:5px;margin-left:10px;cursor:pointer;background:#1fd4fb;color:#fff;">
		 					 </form>
		    			</div>
	    				<ol class="htnav">
							<li><a href="<%=basePath%>approve/count.action">开户审批</a></li>	 
							<li class="changebg"><a href="<%=basePath%>audits/count.action" style="color:#fff;">合同审核</a></li>	 
	    				</ol>
	    				<div class="apprcontent">
	    						<table class="tab">
    								<thead class="thed">
    									<tr>
    										<td>编码</td>
    										<td>申请名称</td>
    										<td>负责人</td>
    										<td>申请类型</td>
    										<td>产品类别</td>
    										<td>承担百分比</td>
    										<td>审批状态</td>
    									</tr>
    								</thead>
    								<tbody class="tbodys">
    									<!-- <tr>
    										<td style="cursor:pointer" onclick="dian()">12</td>
    										<td>123</td>
    										<td>333</td>
    										<td>541551</td>
    										<td>65656</td>
    										<td>2</td>
    										<td>未审批</td>
    									</tr> -->
    								</tbody>
    							</table>	    	   							
    					</div>			
    				</div>
	    			<div class="M-box" style="margin-left:40%"></div> 
	    			</div>
	    			
<%-- 					 <div id="cover3" style="display:block;">
						<div id="cover-bg3"></div>
						<form action="<%=basePath%>audits/submitContract.action" id="cover-content2" method="post" onsubmit="return subs()">
                            <h4>合 同 审 核 详 情<span class="close"></span></h4>
                            <p class="main" style="margin-top:50px;">
                                <span class="leftmain">申 请 单 位</span>
                                <input type="text" class="shurukuang" id="applicant">
                            </p>
                            <p class="main">
                                <span class="leftmain">生 效 时 间</span>
                                <input type="text" id="effectTimeStart"  class="shurukuang" style="width:100px;"><span>至</span><input type="text" id="effectTimeFinish"  class="shurukuang" style="width:100px;">
                            </p>
                            <p class="main">
                                <span class="leftmain">申 请 类 型</span>
                                <input type="text" id="auditType"  class="shurukuang">
                            </p>
                            <p class="main">
                                <span class="leftmain">承担百分比</span>
                                <input type="text" id="assumePercentage"  class="shurukuang">
                            </p>
                            <p class="main">
                                <span class="leftmain">保 证 金&nbsp;&nbsp;&nbsp;&nbsp;</span>
                                <input type="text" id="deposit" class="shurukuang">
                            </p>
                            <p class="main">
                                <span class="leftmain">保证金模式</span>
                                <input type="text" id="depositPattern" class="shurukuang">
                            </p>
                            <p class="main">
                                <span class="leftmain">提 交 时 间</span>
                                <input type="text" id="submitTime"  class="shurukuang" >
                            </p>
                            <p class="main">
                                <span class="leftmain">审 批 类 型</span>
                                <input type="text" id="approveTailId"  class="shurukuang">
                            </p>
                              <p class="main">
								<span class="leftmain">产 品 类 别</span>
								<input type="text"  class="pCategory"  id="pCategory" style="width:255px;">
							</p>
							<p class="main">
								<span class="leftmain">负 责 人</span>
								<input type="text"  class="rPerson"  id="rPerson" style="width:255px;">
							</p>
                            <p class="main" style="height:100px;">
                                <span class="leftmain" style="position:absolute;">其 他 说 明</span>
                                <textarea name="" id="remarks" class="shurukuang" style="height:100px;margin-left: 31%;"></textarea>
                            </p>
                            <p class="main">
					   <input type="button" value="追加协议" onclick="show(this)" id=""  class="xianqi" style="height:30px;line-height:30px;background:#bfbfbf;color:#616264;width: 80px;text-align: center;border-radius: 5px;">
								 <input type="text" id="supplementals"  class="shurukuang">		
							</p>
                            <p class="main">
								<span class="leftmain">审 批 状 态</span>
								<select id="approvalState" name="approveCondition" class="shenfenselect shenfenselect3">
								 <option value="已批准" selected="selected">已批准</option>
                                    <option value="不批准">不批准</option>
								</select>
							</p>
							<p class="main" style="height:100px;">
								<span class="leftmain" style="position:absolute;">审 批 意 见</span>
								<textarea name="approveOpinion" id="approveOpinion" class="shurukuang" style="height:100px;margin-left: 31%;border:1px solid #bfbfbf;background:#fff;"></textarea>
							</p>
							<p class="main" style="height:100px;">
								<span class="leftmain" style="position:absolute;">审 批 说 明</span>
								<textarea name="remarks" id="remarks" class="shurukuang" style="height:100px;margin-left: 31%;border:1px solid #bfbfbf;background:#fff;"></textarea>
							</p>
							 <p><input name="approveid" type="text" id="hiddens" style="display:none;"></p>
							<p class="main" style="text-align:center;margin-top:15px;">
								<button class="btn1 btn2">保存</button>
							</p>  
                        </form>
					 </div> --%>
					 <div id="cover3">
	<form action="<%=basePath%>audits/submitContract.action" method="post" onsubmit="return subs()">
		<table border="" cellspacing="" cellpadding="">
			<thead>
				<tr><th colspan="4">合 同 审 核 详 情<span class="close"></span></th></tr>
			</thead>
			<tbody style="background:#fff;" class="covers">
				<tr>
					<td>申 请 单 位</td>
					<td><input type="text" class="shurukuang" id="applicant" disabled="disabled"></td>
					<td>生 效 时 间</td>
					<td><input type="text" id="effectTimeStart" disabled="disabled"  class="shurukuang" style="width:100px;"><span style="position:relative;">至</span><input disabled="disabled" type="text" id="effectTimeFinish"  class="shurukuang" style="width:100px;"></td>
				</tr>
				<tr>
					<td>申 请 类 型</td>
					<td><input type="text" id="auditType" disabled="disabled"  class="shurukuang"></td>
					<td>承担百分比</td>
					<td><input type="text" id="assumePercentage" disabled="disabled"  class="shurukuang"></td>
				</tr>
				<tr>
					<td>保 证 金</td>
					<td><input type="text" id="deposit" disabled="disabled" class="shurukuang"></td>
					<td>保证金模式</td>
					<td><input type="text" id="depositPattern" disabled="disabled" class="shurukuang"></td>
				</tr>
				<tr>
					<td>签约时间</td>
					<td><input type="text" class="shurukuang" id="signTime" disabled="disabled"></td>
					<td>审 批 类 型</td>
					<td><input type="text" id="approveTailId" disabled="disabled"  class="shurukuang"></td>
				</tr>
				<tr>
					<td>产 品 类 别</td>
					<td><input type="text"   class="shurukuang" disabled="disabled"  id="pCategory" style="width:150px;"></td>
					<td>负 责 人</td>
					<td><input type="text"   class="shurukuang" disabled="disabled"  id="rPerson" style="width:150px;"></td>
				</tr>
				<tr>
					<td>其 他 说 明</td>
					<td><textarea name="" id="remarks" class="shurukuang"  disabled="disabled" style="height:70px;"></textarea></td>
					<td><input type="button" value="上传1" onclick="supplementa(this)" id=""  class="supplementals" style="height:30px;line-height:30px;background:#bfbfbf;color:#616264;width: 80px;text-align: center;border-radius: 5px;"></td>
					<td><input type="text" id="supplementals"  class="shurukuang" disabled="disabled">	</td>
				</tr>
				<tr>
					<td><input type="button" value="上传2" onclick="supplementalsT(this)" id=""  class="supplementalsTwo" style="height:30px;line-height:30px;background:#bfbfbf;color:#616264;width: 80px;text-align: center;border-radius: 5px;"></td>
					<td><input type="text" id="supplementalsTwo"  class="shurukuang" disabled="disabled">	</td>
					<td>审 批 状 态</td>
					<td>
						<select id="approvalState" name="approveCondition" class="shenfenselect shenfenselect3 shurukuang" style="margin-left:0px;width:150px;">
								 <option value="已批准" selected="selected">已批准</option>
                                    <option value="不批准">不批准</option>
								</select>
					</td>
					
				</tr>
				<tr>
					<td>审 批 意 见</td>
					<td><textarea name="approveOpinion" id="approveOpinion" class="shurukuang" style="height:70px;;border:1px solid #bfbfbf;background:#fff;"></textarea></td>
					<td>审 批 说 明</td>
					<td><input name="approveid" type="text" id="hiddens" style="display:none;"><textarea name="remarks" id="remarks" class="shurukuang" style="height:70px;;border:1px solid #bfbfbf;background:#fff;"></textarea></td>
				</tr>
				
				<tr>
					<th colspan="4" style="background:none;padding:10px 0px;"><button class="btn1 btn2">保存</button></th>
				</tr>
			</tbody>
		</table>
	</form>
</div>
<div id="cover-bg3" style="display:none;"></div>
	    		</div>
	    		
	    	</div>
            
    	
    	
        <script type="text/javascript">
        var show;
        function tims(){	    	
	    	var val=true;
	    	if($("#times").val()==""){	    	
	    		alert("请输入申请人姓名!");
	    		return false;
	    	}
	    	return val;
	    }
            $('.M-box').pagination({
            pageCount: ${PageCount},//总页数
			current: ${PageNum},//当前页码
            callback:function(api){
                var pageNum=api.getCurrent();
    		    var condition="${condition}";
                $.ajax({  
                    type : "POST",  
                    url : "<%=basePath%>audits/findApproveAmong.action",//路径  
                    data : {  
                        pageNum : api.getCurrent(),
    	            	"condition" : condition
                    },
                    success : function(data) {
                        var number=data[0].number;//总页数
                        api.setPageCount(number);//动态修改总页数为20页
                        var pageNum=data[0].pageNum;
                        var text="";
                        $('.trs').remove();
                      for(var i=0;i<data[0].list.length;i++){
                    	  text=$('<tr class="trs">'
                          		+'<td style="cursor:pointer" onclick="dian('+data[0].list[i].approveId+')">'+data[0].list[i].approveId+'</td>'
                          		+'<td>'+data[0].list[i].applicant+'</td><td>'+data[0].list[i].rPerson+'</td>'
                          		+'<td>'+data[0].list[i].auditType+'</td><td>'+data[0].list[i].pCategory+'</td>'
                          		+'<td>'+data[0].list[i].assumePercentage+'</td><td>'+data[0].list[i].approvalState+'</td></tr>');
                              $('.tbodys').append(text);
                          }
                      $(".trs:odd").css("background",'#f8f8f8');
                    }
                });  
            }
        },function(api){
            var pageNum;
		    var condition="${condition}";
            $.ajax({  
                type : "POST",  
                url : "<%=basePath%>audits/findApproveAmong.action",//路径  
                data : {  
                    pageNum : api.getCurrent(),
	            	"condition" : condition
                },
                success : function(data) {
    
                    var number=data[0].number;//总页数
                    api.setPageCount(number);//动态修改总页数为20页
                    var pageNum=data[0].pageNum;
                    var text="";  
                    for(var i=0;i<data[0].list.length;i++){
                    	text=$('<tr class="trs">'
                        		+'<td style="cursor:pointer" onclick="dian('+data[0].list[i].approveId+')">'+data[0].list[i].approveId+'</td>'
                        		+'<td>'+data[0].list[i].applicant+'</td><td>'+data[0].list[i].rPerson+'</td>'
                        		+'<td>'+data[0].list[i].auditType+'</td><td>'+data[0].list[i].pCategory+'</td>'
                        		+'<td>'+data[0].list[i].assumePercentage+'</td><td>'+data[0].list[i].approvalState+'</td></tr>');
                            $('.tbodys').append(text);
                          } 
                    $(".trs:odd").css("background",'#f8f8f8');
                }
            });
        });
            function dian(show){
              	 $("#cover3").css("display","block");
              	 $("#cover-bg3").css("display","block");
              	$('body').css("overflow","hidden");
                   $.ajax({
                       url: '<%=basePath %>audits/findContract.action',
                       type: 'post',
                       data: {approveId: show},
                       success:function(data){
                      	   $('#supplementals').val(data[0].supplementals);//申 请 类 型
                      	   $('#applicant').val(data[0].Applicant);//申 请 单 位
                             $('#effectTimeStart').val(data[0].effectTimeStart);//
                             $('#effectTimeFinish').val(data[0].effectTimeFinish);//--
                             $('#auditType').val(data[0].auditType);//申 请 类 型
                             $('#assumePercentage').val(data[0].assumePercentage);//承 担 百 分 比
                             $('#deposit').val(data[0].deposit);//保 证 金
                             $('#depositPattern').val(data[0].depositPattern);//保 证 金  模 式
                             $('#submitTime').val(data[0].submitTime);//提 交 时 间
                             $('#approveTailId').val(data[0].approveTailId);//审 批 类 型
                             $('#approvalState').val(data[0].approvalState);//审 核 状 态
                             $('#pCategory').val(data[0].pCategory);//产品类别
                             $('#rPerson').val(data[0].rPerson);//负责人
                             document.getElementById("remarks").innerText=data[0].remarksremarks;//其 他 说 明
                             $('#supplementals').val(data[0].supplementals);     
                             $('#supplementalsTwo').val(data[0].supplementalsTwo);     
                             $('#hiddens').val(show);//id
                             $('.supplementals').attr("id",show);
                             $('.supplementalsTwo').attr("id",show);
                             $('#signTime').val(data[0].signTime);//签约时间
                       }
                   })
                   
               }
        </script>   
        <script>
        $(".close").click(function(){
            $('body').css("overflow","scroll");
            $('body').css('overflow-x','hidden');
            $("#cover3").removeAttr("style");
            $("#cover-content2").removeAttr("style");
            $("#cover-bg3").css("display","none");
        });
        </script>
          <script type="text/javascript">
        function supplementa(obj){
            	
        	window.location.href="<%=basePath %>audits/download.action?vlaues=0&id="+obj.id;
        }   
        function supplementalsT(obj){
        	
        	window.location.href="<%=basePath %>audits/download.action?vlaues=1&id="+obj.id;
        }   
        function subs(){
      	  var val=true;
      	  if($('#approvalState').val()==""||$('#approvalState').val()==null){
      		  alert('请选择审批状态');
      		  return false;
      	  }
      	  return val;
        }
        </script> 
         
    </body>
</html>
